using System;

namespace CoreManager.Core.Caching
{
    /// <summary>
    /// 缓存配置选项
    /// </summary>
    public class CacheOptions
    {
        /// <summary>
        /// 缓存类型
        /// </summary>
        public CacheType CacheType { get; set; } = CacheType.Memory;

        /// <summary>
        /// Redis连接字符串
        /// </summary>
        public string RedisConnectionString { get; set; } = string.Empty;

        /// <summary>
        /// 缓存键前缀
        /// </summary>
        public string KeyPrefix { get; set; } = "CMgr";

        /// <summary>
        /// 默认过期时间（1小时）
        /// </summary>
        public TimeSpan DefaultExpiration { get; set; } = TimeSpan.FromHours(1);
    }

    /// <summary>
    /// 缓存类型枚举
    /// </summary>
    public enum CacheType
    {
        /// <summary>
        /// 内存缓存
        /// </summary>
        Memory,

        /// <summary>
        /// Redis缓存
        /// </summary>
        Redis
    }
}